<?php 
//get library
eval ("?>$library");
?>
       
            <div class="container">            	                
                <div class="row-fluid">

                    <!-- main content
                    ================================================== -->
                    <div id="mainContent" class="span8">
                        <div id="mainContent_inner">                                                	
                        	<h1>Contact us</h1>
                            <hr />
                            <?php
                            if (isset($success)) { 
                            ?>
                            <div class="alert alert-success">
							  <?=$success?>
							</div>
							<?php 
                            }
							?>
                            <!-- form contact
                    		================================================== -->          
                            <form method="post" action="" class="form-horizontal">
                            
                            	<!-- name & email
                    			================================================== -->
                            	<div class="row-fluid">
                                	<div class="span6 control-group <?=isset($check["name"]) ? "error" : ""?>">
                                    	<label>Your Name (required)</label>
                                        <input type="text" class="input-block-level" name="name" value="<?=isset($values["name"]) ? $values["name"] : ""?>"/>
                                        <?php 
                                        if (isset($check["name"])) {
                                        ?>
                                        <span class="help-inline"><?=$check["name"]?></span>
                                        <?php 
                                        }
                                        ?>
                                    </div>
                                    <div class="span6 control-group <?=isset($check["email"]) ? "error" : ""?>">
                                    	<label>Your Email (required)</label>
                                        <input type="text" name="email" class="input-block-level" value="<?=isset($values["email"]) ? $values["email"] : ""?>" />
                                        <?php 
                                        if (isset($check["email"])) {
                                        ?>
                                        <span class="help-inline"><?=$check["email"]?></span>
                                        <?php 
                                        }
                                        ?>
                                    </div>
                                </div>
                                
                                <!-- message title
                    			================================================== -->
                            	<div class="control-group <?=isset($check["title"]) ? "error" : ""?>">
                                	<label>Message Title (required)</label>
									<input type="text"  name="title" class="input-block-level"  value="<?=isset($values["title"]) ? $values["title"] : ""?>" />
									<?php 
                                    if (isset($check["title"])) {
                                    ?>
                                    <span class="help-inline"><?=$check["title"]?></span>
                                    <?php 
                                    }
                                    ?>                                   
                                </div>
                                
                                <!-- message content
                    			================================================== -->
                                <div class="control-group <?=isset($check["content"]) ? "error" : ""?>">
                                    <label>Content (required)</label>
                                    <textarea class="input-block-level" rows="10" name="content"><?=isset($values["content"]) ? $values["content"] : ""?></textarea>
                                    <?php 
                                    if (isset($check["content"])) {
                                    ?>
                                    <span class="help-inline"><?=$check["content"]?></span>
                                    <?php 
                                    }
                                    ?>
                                                                        
                                </div>
                                                              
                                <!-- Captcha
                    			================================================== -->
                                <div class="control-group <?=isset($check["captcha"]) ? "error" : ""?>">
                                	<label>Security Code</label>
									<script>
							        	var RecaptchaOptions = { theme : 'red'};
							  		</script>
									<script type="text/javascript" src="http://api.recaptcha.net/challenge?k=6LeA0c4SAAAAAMsdjrB49GPol6XImTdJM2U2AHrF"></script>
									<?php 
                                    if (isset($check["captcha"])) {
                                    ?>
                                    <span class="help-inline"><?=$check["captcha"]?></span>
                                    <?php 
                                    }
                                    ?>
                                </div>
                                
                                <!-- submit button
                    			================================================== -->
                                <button type="submit" class="btn btn-primary">Submit</button>
                            </form>
                        </div>
                    </div>

                    <!-- sidebar
                    ================================================== -->
                    <div class="span4">
                        <aside>
                        
                        	<!-- Search
        					================================================== -->
                        	<div class="module-2">
                                <h3 class="title">Search this site</h3>
                                <div class="moduleContent">
                                    <form method="get" action="/search" class="form-inline">
                                    	<input type="text" placeholder="Search article" class="" name="q"  />
                                        <button type="submit" class="btn">Search</button>
                                    </form>
                                </div>
                            </div>
                            
                            <!-- Adv
        					================================================== -->
                            <div class="module-2">                                
                                <div class="moduleContent adv-sidebar">
                                    <?=$ads->getAds300x250()?>
                                </div>
                            </div>
                            
                            <!-- Recent article
        					================================================== -->
                            <div class="module-6">
                                <h3 class="title">Recent article view</h3>
                                <div class="moduleContent">
                                    <ul class="listingStyle" itemscope itemtype="http://schema.org/ItemList">
                                    	<?php 
                                    	foreach ($lastestArticles as $key => $article) {
                                    	?>
                                    	<li itemscope itemtype="http://schema.org/Article" itemprop="itemListElement">
                                        	<h5 itemprop="name" class="articleTitle"><a href="/article/<?=$article->getAlias()?>" itemprop="url"><?=$article->getTitle()?></a></h5>
                                            <span itemprop="dateCreated"><?=date("M, d Y", $article->getCreated())?></span>
                                        </li>
                                        <?php 
                                    	}
                                        ?>
                                    </ul>
                                </div>
                            </div>
                            
                            <!-- Categories
        					================================================== -->
                            <div class="module-6">
                                <h3 class="title">Categories</h3>
                                <div class="moduleContent">
                                    <ul class="listingStyle" itemscope itemtype="http://schema.org/ItemList">
                                    	<?php
                                    	foreach ($lstCategories as $key => $category) { 
                                    	?>
                                    	<li itemprop="itemListElement"><i class="icon-share-alt"></i> <a itemprop="url" href="/category/<?=$category->getAlias()?>"><span itemprop="name"><?=$category->getName()?></span></a></li>
                                    	<?php } ?>
                                    </ul>
                                </div>
                            </div>
                            
                            <!-- Tags
        					================================================== -->
                            <div class="module-2">
                            	<h3 class="title">Tags</h3>                            
                                <div class="moduleContent" itemscope itemtype="http://schema.org/CreativeWork">
                                	<?php 
                                	foreach ($tags as $key => $tag) {
                                	?>
                                    <a href="/tag/<?=urlencode($tag)?>" class="label label-info" itemprop="keywords"><?=$tag?></a>
                                    <?php 
                                	}
                                    ?>
                                </div>
                            </div>
                        </aside>
                    </div>
                </div>
            </div>
